home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / ear / amfax142.lha / AmigaFax / REXX / SpoolFax.rexx next >
OS/2 REXX Batch file  |  1993-12-07  |  1KB  |  67 lines

  1. /*
  2.  * SpoolFax.rexx
  3.  * D. Varley, C-Born Software Systems
  4.  * 07DEC93
  5.  *
  6.  * Synopsis:
  7.  *    Example Rexx script to allow manual spooling of fax files
  8.  *    Written in response to query from Michael Schrader-Boelsche
  9.  *    This is just a quick demo, and could easily be jazzed up!
  10.  *
  11.  * Use:
  12.  *    SpoolFax FaxFile Addressee
  13.  *
  14.  */
  15. options results
  16.  
  17. /* trace results */    /* uncomment this line to debug */
  18.  
  19. /* change these as required */
  20. from  = "786530"
  21. resol = "Fine:"
  22. retries = 3
  23.  
  24. address command
  25.  
  26. parse arg file user
  27.  
  28. /* do some error checking */
  29. if file == "" then do
  30.     say "Usage: SpoolFax faxfile addressee"
  31.     exit(999)
  32. end
  33. if user == "" then do
  34.     say "Usage: SpoolFax faxfile addressee"
  35.     exit(999)
  36. end
  37.  
  38. /* Get spool-file name */
  39.  
  40. sfnum = 0;
  41. do sfnum = 0 to 1000
  42.     sfname = "FAXSPOOL:F_"||sfnum||".SPL"
  43.     if ~exists(sfname) then leave
  44.     if sfnum >= 999 then do
  45.         say "Error: Can't get spool file"
  46.         exit(999)
  47.     end
  48. end
  49.  
  50. res = open('sfile', sfname, 'write')
  51. if res ~= 1 then do
  52.     say "Error: Can't open "||sfname
  53.     exit(999)
  54. end
  55.  
  56. call writeln('sfile', "From: "||from)
  57. call writeln('sfile', "To: "||user)
  58. call writeln('sfile', "Source: No File")
  59. call writeln('sfile', "Fax: "||file)
  60. call writeln('sfile', resol)
  61. call writeln('sfile', "Retries: "||retries)
  62.  
  63. call close('sfile')
  64.  
  65. say file||" Spooled to "||user||" using Spool File "||sfname
  66.  
  67.